home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 4
/
Aminet 4 - November 1994.iso
/
aminet
/
comm
/
fido
/
fz104.lha
/
rexx
/
BBS2Fz.rexx
next >
Wrap
OS/2 REXX Batch file
|
1991-12-29
|
3KB
|
124 lines
/*
*
* Areas.BBS to Foozle.areas Converter
*
* Written 1991 by Peer Hasselmeyer
*
*
* Usage: rx BBS2Fz <in> <out> <fqfa> <pointnet>
* where:
* in - your Areas.BBS file including path
* out - name of created Foozle-areas file, probably
* Foozle.areas
* fqfa - your fully qualified fidonet address, at least
* zone:net/node; point may be omitted
* pointnet - your pointnet, used for remapping fake point
* addresses in the areas.bbs file to their real
* 4d addresses; if you don't want to remap them
* (REALLY? WHY?), use 0 here
*
*/
dupsize = 1 /* DupeTableSize: 0=0; 1=200; 2=500; 3=1000 */
parse arg infile " " outfile " " fqfa " " pointnet
parse var fqfa zone ":" net "/" node "." point
if point = "" then point = 0
if pointnet = "" then do
say "Usage: BBS2Fz <infile> <outfile> <fqfa> <pointnet>"
exit 10
end
if ~open(in, infile, R) then do
say "Couldn't open" infile "!"
exit 10
end
if ~open(out, outfile, W) then do
say "Couldn't open" outfile "!"
call close in
exit 20
end
first = 0
do while ~eof(in)
temp = strip(readln(in), L, " ") /* remove leading white-spaces */
if temp ~= "" then do
if index(";-", left(temp, 1)) = 0 then /* ignore ";" and "-" */
if first = 0 then first = 1
else if CreateArea(temp) ~= 0 then exit 20
end
end
call writech out, copies("00"x, 6)
call close out
call close in
exit
CreateArea:
procedure expose out zone net node point pointnet DupSize
parse arg AreaLine
parse var AreaLine dir tag dest
dir = strip(dir, "b", " ")
tag = strip(tag, "b", " ")
dest = strip(dest, "b", " ")
say "Creating area" Tag
area = copies("00"x, 728) /* Area-Structure */
area = overlay(tag, area) /* your_name */
area = overlay(upper(tag), area, 25) /* net_name */
area = overlay(dir, area, 49) /* directory */
area = overlay("01"x, area, 204) /* # of reply-text */
area = overlay(d2c(DupSize), area, 201) /* DupeTableSize */
z = zone
n = net
f = node
p = point
counter = 209
do while dest ~= ""
parse var dest addr dest
addr = strip(addr, "b", " ")
if addr ~= "" then do
select
when index(addr, ":") > 0 then parse var addr z ":" n "/" f "." p
when index(addr, "/") > 0 then parse var addr n "/" f "." p
when left(addr, 1) = "." then parse var addr "." p
otherwise parse var addr f "." p
end
if p = "" then p = 0
remap = 0
if n = pointnet then do
p = f
n = net /* remap fake points */
f = node
remap = 1
end
sysstr = right("00"x || d2c(z), 2) || right("00"x || d2c(n), 2)
sysstr = sysstr || right("00"x || d2c(f), 2)
sysstr = sysstr || right("00"x || d2c(p), 2)
area = overlay(sysstr, area, counter)
counter = counter + 8
if remap = 1 then do
n = pointnet
f = p
p = 0
end
end
end
okay = 0
if writech(out, area) ~= 728 then do
say "** DISK ERROR !"
okay = 1
end
return okay